﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TextEditor.TextDocument.Action
{
    public class A_SetTextName : A_Action
    {
        public override string ActionName()
        {
            return "settextname";
        }

        public override bool isEnable()
        {
            return this.OwnerDocument.CanModify();
        }

        public override bool UIExecute()
        {
            string strData = ZYCommon.dlgInputBox.InputBox("设置文书标题", "标题内容", this.OwnerDocument.Us.OldTextName);
            if (!string.IsNullOrEmpty(strData))
            {
                this.OwnerDocument.Us.OldTextName = strData;
                this.OwnerDocument.Us.TextName = strData;
                this.OwnerDocument.OwnerControl.Refresh();
            }
            return true;
        }
    }
}
